package com.eiletxie.springcloud.config;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.slf4j.Slf4j;

import java.util.Collection;
import java.util.Map;

@Slf4j
public class OpenFeignRequestInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        log.info("进入统一拦截器接口："+requestTemplate);
        //统一鉴权接口
        requestTemplate.header("jwt","jwt");
        Map<String, Collection<String>> headers = requestTemplate.headers();
        log.info("进入统一拦截器接口："+requestTemplate);
    }
}
